dskjal
広告
広告

ComfyUI で FLUX.2 klein 9B を使う

カテゴリ:deeplearning

Klein はテキストエンコーダーに Qwen 3 8B を使う。dev は Mistral-Small-3.2-24B-Instruct-2506。

FLUX.2 klein 9B(ベース・蒸留両方)は、画像を編集すると色が変わるのが最大の欠点だ。それが問題ないなら Qwen Image Edit の代わりに使える性能を持っている。

t2i なら Z Image Turbo の方がよりリアルでプロンプトの追従性が高い。

目次

必要スペック

最新の ComfyUI は VRAM の量は重要ではなくなっている。なぜなら RAM にモデルをロードして、必要な分を VRAM に転送して処理するようなアルゴリズムになったからだ。画像生成 AI は演算ボトルネックなので、RAM からモデルを転送しつつ推論しても生成速度はほとんど低下しない。

8bit 量子化なら、テキストエンコーダー 8.7 GB、モデル 10 GB なので RAM 32 GB で実行可能。

FLUX.2 dev はテキストエンコーダー 24B、モデル 32B と巨大で、RAM の要求量も大きかった。

モデル

FLUX.2 は精度が高い順に max, pro, flex, dev, klein。

flux-2-klein-9b は4ステップ蒸留モデル。ベースモデルは base がつく(FLUX.2-klein-base-9B)

配置場所URL
models/unetunsloth/flux-2-klein-9b-Q8_0.gguf
models/text_encodersComfy-Org/qwen_3_8b_fp8mixed.safetensors
movels/vaeComfy-Org/flux2-vae.safetensors

Black Forest Labs 公式の VAE は bf16 だが、Comfy-Org の VAE は fp32

ワークフロー

FLUX.2 [klein] 4B & 9B - Fast local image editing and generation からダウンロードできる。

画像を複数枚入力するときは、ReferenceLatent を追加する。klein は最大で4枚の画像入力に対応している

実行速度

環境

入力画像なし

出力解像度推論速度
(s/it)
1,024 x 1,0245.9
1,024 x 1,5368.3

入力画像あり

入力解像度出力解像度推論速度
(s/it)
846 x 1,240846 x 1,24010.8
846 x 1,240768 x 1,53611.6
846 x 1,2401,536 x 1,02413.3

プロンプト

プロンプトから入力画像を参照するには @image1 や @image2 のように指示する。

作例

設定はすべて 4 step、cfg 1。

日本語レンダリング能力は低いが、それ以外はほぼ完璧

日本語レンダリング能力は低いが、それ以外はほぼ完璧

# person
There are three girls in a room.
- left: short red hair and blue eyes. She is sitting on a stool holding a card with the word "左" written on it.
- middle: long silver hair and red eyes. She is standing and holding a card with the word "中" written on it in both hands.
- right: medium brown hair and green eyes. She is sitting on a stool and holding a card with the word "右" written on it.

# background
potted plants and a kitchen.

# style
Anime style.

入力画像

入力画像

結果

結果

Remove the hair red and black ornament on her upper head.
Remove the waist red and black ornament on her left and right waist.
Do not change any irrelevant parts.

入力画像

入力画像

顔や色が変わるのが欠点

顔や色が変わるのが欠点

Create her reference sheet on a pure white background. Draw following four different angles:
- front view on the far left
- left view that facing to the left with her entire body on the middle left
- right view that facing to the right with her entire body on the middle right 
- back view on the far right

dskjal/comfyui-text-renderer でテキストを画像としてレンダリングし、入力している。

The illustration of a chibi girl sitting in a chair eating a piece of pizza. 

There is a table and a window in the indoor room.

# speech bubbles

There are two speech bubbles in vertical writing:

- "日本語の
フキダシを
ちゃんと縦に
書けるかな?"
- "うまく描けない
部分はフキダシで
隠しちゃおう!!"

Qwen Image Edit 2509 Lightning LoRA 4step

Qwen Image Edit 2509 Lightning LoRA 4step

FLUX.2 klein

FLUX.2 klein

入力画像は虎ノ門三丁目方面改札を示す矢印(虎ノ門ヒルズ駅)の無料の写真素材 (c) unific

合成感があるのはキャラの高さが間違っているから。入力画像のアイレベルは画像中央で、およそ 170 cm 前後。なので画面の中央の高さにキャラの頭や目の位置がないとおかしい(つまりキャラの位置が高すぎる)。

FLUX.2 klein

FLUX.2 klein

背景をトリミングして高さを調整

背景をトリミングして高さを調整

A young woman is standing on a subway platform in the @image1.

She is short black hair, wearing a light gray cap, a light colored cropped top and short black pants.

She is holding an iPhone in her left hand.

# background

There are signs, Braille blocks and blurred figures, with a sense of urban transit in the subway station. There is a sign written "出口" on it.

# style

japanese manga, line art, pen art, black and white, halftone

拡大前の画像

拡大前の画像

FLUX.2 klein 9B<br/>色が変わる

FLUX.2 klein 9B
色が変わる

512 x 512 の画像を Upscale Image By の lanczos で3倍に拡大したものを入力している。

Upscale the @image1 and increase the sharpness. Add details. Keep the original style and color.

Qwen Image Edit 2509


広告
広告

カテゴリ